package thread;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created with IntelliJ IDEA.
 * Description: 定时器——Timer类
 * User: 王圆豪
 * Date: 2025-05-05
 * Time: 15:49
 */
public class Demo32 {
    public static void main(String[] args) {
        Timer t = new Timer();
        t.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("hello timer!");
            }
        }, 2000);

        System.out.println("hello main!");
    }
}
